package cn.iocoder.yudao.module.trade.dal.mysql.storeusers;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.trade.dal.dataobject.storeusers.StoreUsersDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.trade.controller.admin.storeusers.vo.*;

/**
 * 店铺账号 Mapper
 *
 * @author 万民匠心
 */
@Mapper
public interface StoreUsersMapper extends BaseMapperX<StoreUsersDO> {

    default PageResult<StoreUsersDO> selectPage(StoreUsersPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoreUsersDO>()
                .eqIfPresent(StoreUsersDO::getStoreId, reqVO.getStoreId())
                .likeIfPresent(StoreUsersDO::getUsername, reqVO.getUsername())
                .eqIfPresent(StoreUsersDO::getPassword, reqVO.getPassword())
                .likeIfPresent(StoreUsersDO::getNickname, reqVO.getNickname())
                .eqIfPresent(StoreUsersDO::getMobile, reqVO.getMobile())
                .eqIfPresent(StoreUsersDO::getRole, reqVO.getRole())
                .eqIfPresent(StoreUsersDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(StoreUsersDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StoreUsersDO::getId));
    }

}